package com.lanou.myapplication.tablayoutAdapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lanou.myapplication.tablelayoutFragment.MyFragment;


/**
 * Created by dllo on 15/10/20.
 */
public class MyAdapter  extends FragmentPagerAdapter{
    private  String[] titles  ={"  头 条  ","  娱 乐  ","  体 育  ","  财 经  ","  教 育  ","  电 影  "};
    public MyAdapter(FragmentManager fm) {

        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return MyFragment.newInstance(position);

    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}

